<?php

namespace app\merchant\controller;

use app\merchant\service\MerchantLoginService;
use think\facade\Request;
use app\BaseController;
use app\Response;

class MerchantLogin extends BaseController
{
    public function merchantLogin(){
        if(Request::method() == 'POST'){
            $data = Request::param();//account 与 password
            try{
                $this->validate($data, 'MerchantLoginCheck');
            }catch (\Exception $e){
                return Response::wrapError(0,$e->getMessage());
            }
            $res = MerchantLoginService::loginService($data);
            return $res;
        }
    }
}